<?php
/**
 * Scans a directory without dots
 * 
 * @param String $path
 * @return array
 */
function scan_dir($path)
{
	// Create a result cache
	$result = array();
	
	// Open the path
	$scan = scandir($path);
	
	// Iterate all scanned dirs and files
	foreach($scan as $line)
	{
		// Skip the dots
		if($line == '.' || $line == '..')
		{
			continue;
		}
		
		// Add to result
		$result[] = $line;
	}
	
	// Return results
	return $result;
}

/**
 * Checks whether the given path exists and is a php file
 *
 * @param String $path
 * @return boolean
 */
function is_php_file($path)
{
	// Check whether the path is a file
	if(is_file($path))
	{
		// Check whether the ending is .php
		if(strpos($path, '.php') == strlen($path) - 4)
		{
			// Return succes
			return true;
		}
	}

	// Return failure
	return false;
}